package com.formiaomiao.demain.util;

import android.os.CountDownTimer;
import android.widget.TextView;

public class TimeCount  extends CountDownTimer {
    private TextView tv;

    public TimeCount(long millisInFuture, long countDownInterval,TextView tv) {
        super(millisInFuture, countDownInterval);
        this.tv = tv;
    }

    @Override
    public void onTick(long millisUntilFinished) {
        tv.setEnabled(false);
        tv.setText("获取验证码("+millisUntilFinished / 1000 +")");
    }

    @Override
    public void onFinish() {
        tv.setEnabled(true);
        tv.setText("获取验证码");

    }
}
